extends ../layout

block vars
  - var title = "登录"

block content
  .container-fluid.container.mt15
      .row-fluid
        .span9.left
          .container-box
            if next
              - action = "/login?next=" + next
            else
              - action = "/login"
            form.form-horizontal(action="#{action}", method='POST')
              fieldset
                #legend.mb50
                  legend 登录
                if notices && notices.length != 0
                  ul.errors.alert.alert-error
                    each notice in notices 
                      li= notice
                if success && success.length != 0
                  ul.alert.alert-success
                    each suc in success
                      li= suc
                .control-group
                  // E-mail
                  label.control-label(for='username') 用户名
                  .controls
                    if username
                      input#email.input-xlarge(type='text', name='username', placeholder='', value="#{username}")
                    else 
                      input#email.input-xlarge(type='text', name='username', placeholder='')
                    p.help-block 请输入您注册时所填用户名
                .control-group
                  // Password
                  label.control-label(for='password') 密码
                  .controls
                    input#password.input-xlarge(type='password', name='password', placeholder='')
                    p.help-block 请输入您的密码（不少于4个字符）
                .control-group
                  // Button
                  .controls
                    input.csrf(type='hidden', name='_csrf', value="#{locals.csrf_token}")
                    button.btn.btn-success 登录
                    a.ml10.mr10.btn(href='/forgot') 忘记密码了
                    a.btn(href='/resend_active_mail') 未收到确认邮件
        .span3.right
          .sidenav.container-box
            ul
              li
                a(href='#')
              li
                a(href='/setting') 用户中心
              li
                a(href='/setting/avatar') 设置头像
              li
                a(href='/setting/password') 设置密码
              li
                a(href='/') 返回首页
